﻿using System;
using System.ComponentModel;
using System.Windows;

namespace Com.Lancetinc.Evs.Controls
{
    /// <summary>
    /// CameraPropPowerLineSettingUserControl.xaml 的交互逻辑
    /// </summary>
    public partial class CameraPropPowerLineSettingUserControl
    {
        const int POWERLINE_50HZ = 1;
        const int POWERLINE_60HZ = 2;

        public CameraPropPowerLineSettingUserControl()
        {
            InitializeComponent();
        }

        protected override void OnCameraPropChange(PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "CameraPropValue")
            {
                if (cameraPropViewModel.CameraPropValue == POWERLINE_50HZ)
                {
                    Radio50Hz.IsChecked = true;
                }
                else
                {
                    Radio60Hz.IsChecked = true;
                }
            }
        }

        private void Radio50Hz_Checked(object sender, RoutedEventArgs e)
        {
            cameraPropViewModel.CameraPropValue = POWERLINE_50HZ;
        }

        private void Radio60Hz_Checked(object sender, RoutedEventArgs e)
        {
            cameraPropViewModel.CameraPropValue = POWERLINE_60HZ;
        }
    }
}
